package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import nl.coderight.jazz.dialog.MessageDialog;
import nl.coderight.jazz.dialog.MessageType;
import jtk.project4.fleet.domain.FuelRec;

public class FuelRecDao extends IbatisDao {
	
	public List selectFuelRec() throws SQLException {
		List selectFuelRec = null;
			selectFuelRec =getSqlMap().queryForList("SELECT_ALL_FUELREC", null);
		return selectFuelRec;
	}

	public int deleteFuelRec(FuelRec fuelRec) throws SQLException{
		return (int) getSqlMap().delete("DELETE_FUELREC", fuelRec);
	}
	
	public int updateFuelRec(FuelRec fuelRec) throws SQLException{
		return (int) getSqlMap().update("UPDATE_FUELREC", fuelRec);
	}
	
	public FuelRec insertFuelRec(FuelRec fuelRec) throws SQLException{
		return (FuelRec) getSqlMap().insert("INSERT_FUELREC", fuelRec);
	}

	public FuelRec insertFuelRecType(FuelRec fuelRec) throws SQLException {
		return (FuelRec) getSqlMap().insert("INSERT_FUELREC_TYPE",fuelRec);
	}
	
		public List selectFuelRecType() throws SQLException {
		return getSqlMap().queryForList("SELECT_ALL_FUELREC_TYPE", null);
	}
	
		
	public static void main (String args[]) throws SQLException{
		FuelRec fuelRec;
		fuelRec = new FuelRec();
		fuelRec.setPoNo("hembremmmm");
		new FuelRecDao().insertFuelRec(fuelRec);
		}
}